package com.cat.conf.spi;

import com.cat.service.spi.SpiInterface;

import java.util.Iterator;
import java.util.ServiceLoader;

/**
 * ？
 *
 * @author xiemh
 * @date 2019/1/28 14:04
 * @since v1.0.0
 */
public class SpiTest {

    public static void main(String[] args) {
        ServiceLoader<SpiInterface> spiLoader = ServiceLoader.load(SpiInterface.class);
        Iterator<SpiInterface> iteratorSpi=spiLoader.iterator();
        while (iteratorSpi.hasNext()){
            SpiInterface svc=iteratorSpi.next();
            svc.speak();
        }
    }
}
